<a data-page="prev" class="btn{{if current == 1 || totalPage == 0}} disabled{{/if}} js-page turn-page" href="javascript:;">&lt;</a>
{{each totalArr as i idx}}

    {{if i == 1}}
        <a data-page="{{i}}" class="btn{{if current == i}} current{{/if}} js-page" href="javascript:;">{{i}}</a>
        {{if current > 7}}<span class="text">...</span>{{/if}}
    {{/if}}

    {{if i != 1 && i != totalPage}}
        {{if current < 8}}
            {{if i < 9}}
                <a data-page="{{i}}" class="btn{{if current == i}} current{{/if}} js-page" href="javascript:;">{{i}}</a>
            {{/if}}
        {{else}}
            {{if current > totalPage - 7}}
                {{if i >= totalPage - 7}}
                    <a data-page="{{i}}" class="btn{{if current == i}} current{{/if}} js-page" href="javascript:;">{{i}}</a>
                {{/if}}
            {{else}}
                {{if i > current - 4 && i < current + 4}} 
                    <a data-page="{{i}}" class="btn{{if current == i}} current{{/if}} js-page" href="javascript:;">{{i}}</a>
                {{/if}}
            {{/if}}
        {{/if}}
    {{/if}}
    
    {{if i == totalPage && i != 1}}
        {{if totalPage > 9 && current < totalPage - 6}}<span class="text">...</span>{{/if}}
        <a data-page="{{i}}" class="btn{{if current == i}} current{{/if}} js-page" href="javascript:;">{{i}}</a>
    {{/if}}

{{/each}}
<a data-page="next" class="btn{{if current == totalPage || totalPage == 0}} disabled{{/if}} js-page turn-page" href="javascript:;">&gt;</a>